<?php
class KolSys_Singleton
{
	public static $instances = array();
	public static function &getInstance ($classNameString)
	{
		$instances=&self::$instances;
		if (!array_key_exists($classNameString, $instances)) {
			$instances[$classNameString] = new $classNameString;
		}
		$instance =& $instances[$classNameString];
		return $instance;
	}//method
	
	public static function instanceExists($classNameString)
	{
		return array_key_exists($classNameString, self::$instances);
	}
}//class